<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <el-button type="primary" icon="el-icon-plus" v-auth="'store.create'" @click="create"></el-button>
                <el-button type="danger" plain icon="el-icon-delete" v-auth="'store.delete'" v-if="selection.length>0" :disabled="selection.length==0" @click="dels"></el-button>
            </div>
            <div class="right-panel">
                <div class="right-panel-search">
                    <el-input v-model="search" placeholder="搜索" @clear="this.$TABLE.searchSubmit(this)" clearable></el-input>
                    <el-button type="primary" icon="el-icon-search" @click="this.$TABLE.searchSubmit(this)"></el-button>
                    <imiFilterBar :options="options" @filterChange="filterChange"></imiFilterBar>
                </div>
            </div>
        </el-header>
        <el-main class="nopadding">
            <scTable ref="table" row-key="id" :apiObj="apiObj" :params="params" @selection-change="selectionChange" stripe @cell-dblclick="doubleClick" remoteSort remoteFilter>
                <el-table-column type="selection" width="50"></el-table-column>
                <el-table-column label="店铺ID" prop="id" >
                                    
				</el-table-column>
                <el-table-column label="店铺名称" prop="name" >
                                    
				</el-table-column>
                <el-table-column label="LOGO" prop="logo_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.logo_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column width="200px" label="用户id" prop="user_id" >
                    <template #default="scope"  >
                    <el-tag >{{userList[scope.row.user_id]}} </el-tag>
                    </template>  
				</el-table-column>

                <el-table-column label="店铺角色" prop="set_id" >
                    <template #default="scope">
                    <el-tag >{{set_id_option[scope.row.set_id]}} </el-tag>
                    </template> 
				</el-table-column>
                <!-- <el-table-column label="签名" prop="sign" >
                                    
				</el-table-column> -->
                <el-table-column label="banner图片" prop="banner_image" >
                    <template #default="scope">
                    <el-image :src="scope.row.banner_image" size="small"></el-image>
                    </template>                
				</el-table-column>
                <!-- <el-table-column label="店铺内容" prop="content" >
                                    
				</el-table-column> -->
                <!-- <el-table-column label="状态" prop="status" >
                                    
				</el-table-column> -->

         

                <el-table-column label="公司类型" prop="ltdtype_status" >
                    <template #default="scope">
                        <div class="success" style="color: #0a0a59" v-if="scope.row.ltdtype_status=='individual'">个体</div>
                        <div class="info" style="color: #a855a3" v-if="scope.row.ltdtype_status=='ordinary'">普通企业</div>
                    </template>
				</el-table-column>


                <el-table-column label="考试状态" prop="test_status" >
                    <template #default="scope">
                        <div class="success" style="color: #0a0a59" v-if="scope.row.test_status=='0'">未知</div>
                        <div class="success" style="color: #0a0a59" v-if="scope.row.test_status=='1'">免考</div>
                        <div class="info" style="color: #a855a3" v-if="scope.row.test_status=='2'">已考</div>
                    </template>
				</el-table-column>
                <el-table-column label="审核状态" prop="apply_status" >
                    <template #default="scope">
                        <div class="success" style="color: #0a0009" v-if="scope.row.apply_status=='0'">未知</div>
                        <div class="success" style="color: #0a0a59" v-if="scope.row.apply_status=='1'">申请中</div>
                        <div class="info" style="color: #0855a3" v-if="scope.row.apply_status=='2'">已通过</div>
                        <div class="info" style="color: #aa55a3" v-if="scope.row.apply_status=='3'">已拒绝</div>
                    </template>
                                    
				</el-table-column>
                <el-table-column label="企业OR个人" prop="ltd_status" >
                                    
				</el-table-column>
                <el-table-column label="审核备注" prop="apply_ps" >
                                    
				</el-table-column>
                <el-table-column label="浏览量" prop="views" >
                                    
				</el-table-column>
                <el-table-column label="备注" prop="remark" >
                                    
				</el-table-column>
                <el-table-column label="联系人姓名" prop="contacts_name" >
                                    
				</el-table-column>
                <el-table-column label="联系人手机号" prop="mobile" >
                                    
				</el-table-column>
                <el-table-column label="地址" prop="addr" >
                                    
				</el-table-column>
                <el-table-column label="注册 IP" prop="register_ip" >
                                    
				</el-table-column>
                <el-table-column label="过期时间" prop="expire_time"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="考试成绩" prop="exam_scores" >
                                    
				</el-table-column>
                <el-table-column label="身份证号" prop="sfz" >
                                    
				</el-table-column>
                <el-table-column label="身份证正面" prop="sfz1_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.sfz1_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column label="身份证反面" prop="sfz2_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.sfz2_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column label="手持身份证" prop="sfz3_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.sfz3_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column label="自我声明ID" prop="declaration_id" >
                                    
				</el-table-column>
                <el-table-column label="签名照" prop="sign_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.sign_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column label="营业执照到期日" prop="bbl_expire_time"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="金额" prop="money" >
                                    
				</el-table-column>
                <el-table-column label="贝壳" prop="shell" >
                                    
				</el-table-column>
                <el-table-column label="保证金" prop="surety" >
                                    
				</el-table-column>
                <el-table-column label="积分" prop="score" >
                                    
				</el-table-column>
                <el-table-column label="划拨" prop="assign" >
                                    
				</el-table-column>
                <el-table-column label="阀值" prop="threshold" >
                                    
				</el-table-column>
                <!-- <el-table-column label="营业时间" prop="work_time"  align="right" width="180" :formatter="this.$TABLE.datetime"> -->
                                    
                <el-table-column label="营业时间" prop="work_time"  align="right" width="180">
				</el-table-column>
                <el-table-column label="营业类型" prop="storebusinesstype_ids" >
                                    
				</el-table-column>
                <el-table-column label="营业类型" prop="storebusinesstype_text" >
                                    
				</el-table-column>
                <el-table-column label="可销售主分类" prop="goodscate_ids" >
                                    
				</el-table-column>
                <el-table-column label="营业商品类型" prop="goodscate_text" >
                                    
				</el-table-column>
                <el-table-column label="店铺类型" prop="storetype_id" >
                                    
				</el-table-column>
                <el-table-column label="信誉值" prop="credit" >
                                    
				</el-table-column>
                <el-table-column label="纬度" prop="lat" >
                                    
				</el-table-column>
                <el-table-column label="经度" prop="lng" >
                                    
				</el-table-column>
                <el-table-column label="最后登录IP" prop="login_ip" >
                                    
				</el-table-column>
                <el-table-column label="最后登录时间" prop="login_time"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="创建者" prop="creator" >
                                    
				</el-table-column>
                <el-table-column label="更新者" prop="updater" >
                                    
				</el-table-column>
                <el-table-column label="创建时间" prop="createtime"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="更新时间" prop="updatetime"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="删除时间" prop="deletetime"  align="right" width="180" :formatter="this.$TABLE.datetime">
                                    
				</el-table-column>
                <el-table-column label="好评" prop="good" >
                                    
				</el-table-column>
                <el-table-column label="评论数" prop="comments" >
                                    
				</el-table-column>
                <el-table-column label="差评" prop="bad" >
                                    
				</el-table-column>
                <el-table-column label="收藏数" prop="likes" >
                                    
				</el-table-column>
                <el-table-column width="200px" label="辅导员" prop="pid" >
                    <template #default="scope"  >
                    <el-tag >{{userList[scope.row.user_id]}} </el-tag>
                    </template>  
				</el-table-column>
       
                <el-table-column label="admin_id" prop="admin_id" >
                                    
				</el-table-column>
                <el-table-column label="店铺二维码" prop="qr" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.qr" size="small"></el-avatar>
                    </template>                
				</el-table-column>
                <el-table-column label="银行开户姓名" prop="bank_account_name" >
                                    
				</el-table-column>
                <el-table-column label="银行账号" prop="bank_account" >
                                    
				</el-table-column>
                <el-table-column label="银行支行名称" prop="bank_branch_name" >
                                    
				</el-table-column>
                <el-table-column label="银行支行行号" prop="bank_branch_number" >
                                    
				</el-table-column>
                <el-table-column label="微信真实姓名" prop="wechat_name" >
                                    
				</el-table-column>
                <el-table-column label="微信分账openid" prop="wechat_openid" >
                                    
				</el-table-column>
                <el-table-column label="支付宝真实姓名" prop="ali_name" >
                                    
				</el-table-column>
                <el-table-column label="支付宝账号" prop="ali_account" >
                                    
				</el-table-column>
                <el-table-column label="激活码" prop="activation_code" >
                                    
				</el-table-column>
                <el-table-column label="企业名称" prop="ltd_name" >
                                    
				</el-table-column>
                <el-table-column label="社会信用代码" prop="ltd_uscc" >
                                    
				</el-table-column>
                <el-table-column label="公司法人" prop="ltd_contacts" >
                                    
				</el-table-column>
                <el-table-column label="法人手机号" prop="ltd_tel" >
                                    
				</el-table-column>
                <el-table-column label="证件照" prop="paper_images" >
                    <template #default="scope">
                        <el-avatar v-if="scope.row.paper_images==null" :src="scope.row.paper_images" size="small"></el-avatar>
                        <el-avatar v-else v-for="item in scope.row.paper_images.split(',')"  :src="item" size="small"></el-avatar>
                    </template>       
				</el-table-column>
                <el-table-column label="营业执照照片" prop="bbl_image" >
                    <template #default="scope">
                    <el-avatar :src="scope.row.bbl_image" size="small"></el-avatar>
                    </template>                
				</el-table-column>
       
                <!-- <el-table-column label="开放平台" prop="unionid" >
                                    
				</el-table-column> -->
                <el-table-column label="认证费用" prop="payca_status" >
                    <template #default="scope"  >
                    <el-tag >{{payca_status_option[scope.row.payca_status]}} </el-tag>
                    </template>  
				</el-table-column>
                <el-table-column label="店铺码" prop="invite_code" >
                                    
				</el-table-column>
                
                <el-table-column label="操作" fixed="right" align="right" width="140">
                    <template #default="scope">
                        
                        <el-button type="text"  size="small" @click="edit_goodsbrand(scope.row)">编辑品牌</el-button>
                        <el-button type="text"  size="small" @click="apply_pass(scope.row)">申请审核</el-button>
                        <el-button type="text" v-auth="'store.update'" size="small" @click="update(scope.row)">查看
                        </el-button>
                        <el-popconfirm title="确定删除吗？" @confirm="del(scope.row)">
                            <template #reference>
                                <el-button type="text" v-auth="'store.delete'" size="small">删除</el-button>
                            </template>
                        </el-popconfirm>
                    </template>
                </el-table-column>
            </scTable>
        </el-main>
    </el-container>
    <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
    <pass v-if="asynDialog2" ref="pass" @success="handleSuccess" @closed="asynDialog2 = false"></pass>
    <goodsbrand v-if="asynDialog3" ref="goodsbrand" @success="handleSuccess" @closed="asynDialog3 = false"></goodsbrand>
</template>
<script>
    import pass from './pass';
    import goodsbrand from './goodsbrand';
    
    import saveDialog from './save';
    import imiFilterBar from '@/components/imiFilterBar';
    export default {
        name: 'store',
        components: {
            pass,
            goodsbrand,
            saveDialog,
            imiFilterBar
        },
        data() {
            return {
                asynDialog2: false,
                asynDialog3: false,
                options: [
                    {
                        label: '店铺ID',
                        value: 'id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺名称',
                        value: 'name',
                        type: 'text',
                        operator: 'like',
                    },
					{
                        label: '用户id',
                        value: 'user_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '签名',
                        value: 'sign',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺内容',
                        value: 'content',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '状态',
                        value: 'status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '考试状态',
                        value: 'test_status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '审核状态',
                        value: 'apply_status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '企业OR个人',
                        value: 'ltd_status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '审核备注',
                        value: 'apply_ps',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '浏览量',
                        value: 'views',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '备注',
                        value: 'remark',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '联系人姓名',
                        value: 'contacts_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '联系人手机号',
                        value: 'mobile',
                        type: 'text',
                        operator: 'like',
                    },
					{
                        label: '地址',
                        value: 'addr',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '注册 IP',
                        value: 'register_ip',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '套餐编号',
                        value: 'package_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '过期时间',
                        value: 'expire_time',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '考试成绩',
                        value: 'exam_scores',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '身份证号',
                        value: 'sfz',
                        type: 'text',
                        operator: 'like',
                    },
					{
                        label: '自我声明ID',
                        value: 'declaration_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '营业执照到期日',
                        value: 'bbl_expire_time',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '金额',
                        value: 'money',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '贝壳',
                        value: 'shell',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '保证金',
                        value: 'surety',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '积分',
                        value: 'score',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '划拨',
                        value: 'assign',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '阀值',
                        value: 'threshold',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '营业时间',
                        value: 'work_time',
                        // type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '营业类型',
                        value: 'storebusinesstype_ids',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '营业类型',
                        value: 'storebusinesstype_text',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '可销售主分类',
                        value: 'goodscate_ids',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '营业商品类型',
                        value: 'goodscate_text',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺类型',
                        value: 'storetype_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '信誉值',
                        value: 'credit',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '纬度',
                        value: 'lat',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '经度',
                        value: 'lng',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '最后登录IP',
                        value: 'login_ip',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '最后登录时间',
                        value: 'login_time',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '创建者',
                        value: 'creator',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '更新者',
                        value: 'updater',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '创建时间',
                        value: 'createtime',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '更新时间',
                        value: 'updatetime',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '删除时间',
                        value: 'deletetime',
                        type: 'datetimerange',
                        operator: 'between',
                    },
					{
                        label: '可用文件占用大小KB',
                        value: 'now_filesize',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '已用文件占用大小KB',
                        value: 'filesize',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '好评',
                        value: 'good',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '评论数',
                        value: 'comments',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '差评',
                        value: 'bad',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '收藏数',
                        value: 'likes',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '邀请人',
                        value: 'pid',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺角色ID',
                        value: 'set_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: 'admin_id',
                        value: 'admin_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺二维码',
                        value: 'qr',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '银行开户姓名',
                        value: 'bank_account_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '银行账号',
                        value: 'bank_account',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '银行支行名称',
                        value: 'bank_branch_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '银行支行行号',
                        value: 'bank_branch_number',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '微信真实姓名',
                        value: 'wechat_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '微信分账openid',
                        value: 'wechat_openid',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '支付宝真实姓名',
                        value: 'ali_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '支付宝账号',
                        value: 'ali_account',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '激活码',
                        value: 'activation_code',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '企业名称',
                        value: 'ltd_name',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '社会信用代码',
                        value: 'ltd_uscc',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '公司法人',
                        value: 'ltd_contacts',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '法人手机号',
                        value: 'ltd_tel',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '省id',
                        value: 'province_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '城市id',
                        value: 'city_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '区id',
                        value: 'district_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '乡镇id',
                        value: 'town_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '地区id',
                        value: 'area_id',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '公司类型',
                        value: 'ltdtype_status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '开放平台',
                        value: 'unionid',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '认证费用',
                        value: 'payca_status',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '店铺码',
                        value: 'invite_code',
                        type: 'text',
                        operator: '=',
                    },
					{
                        label: '支付密码',
                        value: 'pay_password',
                        type: 'text',
                        operator: '=',
                    },
					                    
                ],
                dialog: {
                    save: false
                },
                apiObj: this.$API.store.read,
                selection: [],
                search: '',
                params:{},

                status_option:{"0":"关闭","1":"正常"},
				test_status_option:{"0":"未知","1":"免考","2":"已考"},
				apply_status_option:{"0":"未知","1":"申请中","2":"已通过","3":"已拒绝"},
				ltd_status_option:{"1":"个人","2":"企业"},
				ltdtype_status_option:{"individual":"个体","ordinary":"普通企业"},
				payca_status_option:{"1":"待支付","2":"已支付"},
				money_status_option:{"1":"平台提现","2":"执行分账"},
				close_status_option:{"1":"未打烊","2":"打烊"},
				city_switch_option:{"0":"不支持","1":"支持"},

                set_list_option:[],
                userList:[],
            }
        },
        created() {
            this.$TABLE.setFilterValue(this);
            this.getuserList();
            this.getSet2();//表格加载时会执行该方法
        },
        mounted() {

               
        },
        methods: {
             async getSet2(){//需要加入的方法
                
                var res = await this.$API.set.read.get({page: 1,pageSize: 99});
                var list = res.data.list;
                var set_list_option = [];
                for (let index = 0; index < list.length; index++) {
                    set_list_option[list[index].id] = list[index].name;                    
                }
                console.log(set_list_option);
                this.set_id_option = set_list_option;
            },
            async getuserList(){
                var res = await this.$API.fa_user.read.get({page: 1,pageSize: 999999})
                var list = res.data.list;
                var data = [];
                for (let index = 0; index < list.length; index++) {
                    data[list[index].id] = list[index].id+'👉'+list[index].nickname;                    
                }
                // console.log(data);
                this.userList = data;
            },
            // 双击单元格触发事件
            doubleClick(row) {
                this.update(row);
                // row[column.property + 'Show'] = true
                // this.updateTable()
                // this.$nextTick(() => {
                //     this.$refs[column.property] && this.$refs[column.property].focus()
                // })
            },
            apply_pass(row){
                this.asynDialog2 = true
                this.$nextTick(() => {
                    this.$refs.pass.open('update').setData(row)
                })
			},

            
            edit_goodsbrand(row){
                this.asynDialog3 = true
                this.$nextTick(() => {
                    this.$refs.goodsbrand.open('update').setData(row)
                })
			},
            filterChange(data) {
                this.$TABLE.filter(data, this);
            },
            create() {
                this.dialog.save = true
                this.$nextTick(() => {
                    this.$refs.saveDialog.open()
                })
            },
            
            update(row) {
                this.dialog.save = true
                this.$nextTick(() => {
                    this.$refs.saveDialog.open('update').setData(row)
                })
            },
            async del(row) {
                var res = await this.$API.store.delete.post({ids: row.id});
                if (res.code == 200) {
                    this.$refs.table.refresh()
                    this.$message.success(res.message)
                } else {
                    this.$alert(res.message, "提示", {type: 'error'})
                }
            },
            async dels() {
                if (!this.selection.length) {
                    this.$message.warning("请选择要删除的数据")
                    return false;
                }
                var ids = [];
                for (const i in this.selection) {
                    ids.push(this.selection[i].id)
                }
                this.$confirm(`确定删除选中的 ${this.selection.length} 项吗？`, '提示', {
                    type: 'warning'
                }).then(() => {
                    const loading = this.$loading();
                    this.$API.store.delete.post({ids:ids}).then(res => {
                        if (res.code == 200) {
                            this.$refs.table.refresh()
                            this.$message.success(res.message)
                        } else {
                            this.$message.error(res.message)
                        }
                        loading.close();
                    });
                })
            },
            selectionChange(selection) {
                this.selection = selection;
            },
            handleSuccess() {
                this.$refs.table.refresh()
            }
        }
    }
</script>